const {getHttpList} = require("../../models/http")
Page({
  data: {
    playlists:""
  },
  onLoad: function (options) {
    this.getHttpData()
  },
  onReachBottom(){
    this.getHttpData()
  },
  getHttpData(){
    getHttpList({
      offset:this.data.playlists.length,
      success:res=>{
       var playlists =[...this.data.playlists,...res.data.playlists] 
       this.setData({
         playlists
       })
      }
    })
  },
  handleClick(event){
    let {id} = event.currentTarget.dataset
    wx.navigateTo({
      url: `/pages/detail/detail?id=${id}`
    })
  }
})